require.config({
    baseUrl:PUBLIC + "/Common/KindEditor"
});
define(function(require){
    require('kindeditor');

    var editor_name = document.getElementById('editor_name').value;
    var UID = document.getElementById('UID').value;
    var MODULE_NAME = document.getElementById('MODULE_NAME').value;
    var operator = MODULE_NAME=='Admin'?'manage':'user';
    var editor;

    KindEditor.ready(function(K) {
        editor =K.create('textarea[name="'+editor_name+'"]',{
            cssPath : PUBLIC+'/Common/KindEditor/plugins/code/prettify.css',
            uploadJson :FILEHOST,
            fileManagerJson : FILEHOST + 'file_manager_json.php',//20150104添加，文件管理空间
            filePostName : 'files[]',
            filterMode : false,
            allowFileManager : true,
            uploadFileJson : FILEHOST,
            extraFileUploadParams : {'do':'upload_editor_file','do_type':'ZG93bmxvYWQ=','operator':operator},//文件上传参数
            extraImageUploadParams : {'do':'upload_editor','do_type':'cHJvZHVjdA==','operator':operator},//图片上传参数

            afterCreate : function() {
                this.sync();
            },
            afterBlur:function(){
                this.sync();
            },
            resizeType:1
        });
    });
});